﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Freecart_Local_.Controls;
using System.Text;
using Freecart_Local_.Classes;
namespace Freecart_Local_.Pages.Admin
{
    public partial class Control_Panel : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {

            }
            else
            {
                // get postback data
            }
        }

        protected void btnActiveCarts_Click(object sender, EventArgs e)
        {
            LiteralControl lit = new LiteralControl();
            StringBuilder str = new StringBuilder();
            int i = 1;

            foreach (Cart c in CartManager.ReturnAllCarts())
            {
                str.Append(i++ + ". " + c.Guid + "<br>");
            }

            lit.Text = str.ToString();
            PlaceHolderPostback.Controls.Add(lit);
        }

        protected void btnClear_Click(object sender, EventArgs e)
        {
            CartManager.ClearCarts();
        }
    }
}
